package com.xiaolaoban.user_center_back_end.common;

import lombok.Data;

/**
 * 基本响应类
 */

@Data
public class BaseResponse<T> {
    private Integer code;
    private T data;
    private String massage;
    private String description;

    public BaseResponse(Integer code, String massage) {
        this.code = code;
        this.massage = massage;
        this.data = null;
        this.description = null;
    }


    public BaseResponse(Integer code, T data, String massage, String description) {
        this.code = code;
        this.data = data;
        this.massage = massage;
        this.description = description;
    }

    public BaseResponse(ErrorCode errorCode) {
        this.code = errorCode.getCode();
        this.data = null;
        this.massage = errorCode.getMessage();
        this.description = errorCode.getDescription();
    }
}
